<template>
  <div class="brandList">
    <h3>品牌制造商直供</h3>
    <ul>
      <li v-for="item in brandList" :key="item.id" @click="btn(item.id)">
        <img :src="item.pic_url" alt="" />
        <p>{{ item.name }}</p>
        <span>{{ item.floor_price | Price }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "VueBrandlist",

  data() {
    return {};
  },
  props: ["brandList"],

  mounted() {},

  methods: {
    btn(id) {
      //console.log(id);
      console.log(this.$router);
      this.$router.push({ path: "/detail", query: { id } });
    },
  },
};
</script>

<style lang="less" scoped>
.brandList {
  h3 {
    text-align: center;
    margin: 15px 0;
  }
  ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    li {
      display: flex;
      width: 49%;
      position: relative;
      flex-direction: column;
      margin: 2px 0;
      p {
        position: absolute;
        top: 5px;
        left: 10px;
        font-size: 16px;
      }
      span {
        position: absolute;
        top: 25px;
        left: 10px;
        font-size: 13px;
        color: rgb(145, 25, 25);
      }
      img {
        width: 100%;
      }
    }
  }
}
</style>
